#include<iostream>
#include<string>
using namespace std;
string s;
int n, d;
int main()
{
	cin >> n >> d;
	cin >> s;
	if (s[n - 1] == '0') {
		cout << -1 << endl;
		return 0;
	}
	int ans = 0;
	for (int i = 0; i < n; ) {
		int idx = i;
		bool flag = 0;
		for (int j = min(d + i,n - 1); j > i; j--) {
			if (s[j] == '1') {
				ans++;
				idx = j;
				flag = 1;
				break;
			}
		}
		//cout << "idx==" << idx << endl;
		i = idx;
		if (i == n - 1)break;
		if (!flag) {
			cout << -1 << endl;
			return 0;
		}
	}
	cout << ans << endl;
	return 0;
}